<table>
<caption>Tabla <?php echo $this->tabla; ?></caption>
<thead>
  <tr>
    <td>Campo nombre</td>
    <td>Tipo control</td>
    <td>Visible</td>
    <td>Requerido</td>
    <td>Editar</td>
  </tr>
</thead>
<tbody>
<?php 
$formulario = $this->formulario;

foreach ($formulario->getSubformularios() as $subformulario)
{
  if ($formulario->getSubformularios()->count() > 1) 
  {
  ?>
  <tr>
    <td colspan="5">Subformulario: <?= $subformulario->getEtiqueta(); ?></td>
  </tr>      
  <?php 
  }
  foreach ($subformulario->getCampos() as $campo)
  {
    if (strlen($campo->getElemento()->getNombre()) == 0) 
    {
      $elemento = $campo->getElemento();
      $elemento->find($elemento->getIdElemento());
    }
  ?>
    <tr>
      <td><?= $campo->getNombre(); ?></td>
      <td><?= $elemento->getNombre(); ?></td>
      <td><?= ($campo->getVisible()) ? ('Si') : ('No'); ?></td>
      <td><?= ($campo->getRequerido()) ? ('Si') : ('No'); ?></td>
      <td><?= 'Editar'; ?></td>
    </tr>
  <?php 
  }
  if ($formulario->getSubformularios()->count() > 1) 
  {
  ?>
  <tr>
    <td colspan="5">&nbsp;</td>
  </tr>      
  <?php 
  }
}
?>
  <tr>
    <td colspan="5" style="text-align: center;">
      <?= $this->frmGuardar; ?>
    </td>
  </tr>
</tbody>
</table>